// 封装banner轮播图逻辑相关的业务代码
import { ref, onMounted } from 'vue'
import { getBannerService } from '@/apis/layout'

export const useBanner = () => {
  const bannerList = ref([]) 
  const getBannerList = async(distributionSite = '1') => {
    const res = await getBannerService({
      distributionSite
    })
    bannerList.value = res.result
  }
  onMounted(() => {
    getBannerList()
  })
  return {
    bannerList,
    getBannerList
  }
}